EMT Practice Test

1. Question Content...


Question List

Question1: In the module located at app/code/MyCompany/MyModule there is a JS module in the file view/frontend/web/register.js. The Magento base URL is https://magento.host/ and the luma theme with the en_US locate is used.
What is the public URL for this file?

Question2: Magento allows you to specify custom values per store for product attributes created in the admin panel.
Which architectural pattern makes it possible?

Question3: You have created a custom module which must perform an action immediately after an order is placed, but only on the store front of the merchant site. You have selected the checkout_submit_all_after as the target event which the module will observe.
In which file will the event observer be declared?

Question4: You have created a module with a custom ACL resource and want to restrict access to resources of your module.
Which three items are restricted based on ACL role permissions? (Choose three.)

Question5: You are adding a new entry to the backend menu that appears after
Marketing > SEO & Search > Site Map
You see the existing site map menu item is declared by the node:

What two actions do you take to configure the new menu entry location? (Choose two.)

Question6: What is a valid use case for an around plugin?

Question7: A client has asked you to include category url keys in product URLs.
How is this done?

Question8: You need to add a new text attribute to all products in the Magento store. When this attribute is displayed on the product page, its values must be different depending on the selected language.
Keeping simplicity in mind, how do you add this attribute?

Question9: You are adding a child node to the product.info block using the XML:

How will this block be rendered?

Question10: A merchant asks you to extend customer functionality to allow customer accounts to be associated with two or more billing addresses.
How is this implemented?

Question11: You have been given the task of importing products from an external source. You decide to create a custom module to do this. The class handling the import creates a product for each record, sets the data on it and saves it to the database.
What do you inject into a constructor to represent each product you create?

Question12: You added a plugin declaration to MyCompany/MyModule/etc/di.xml:

What will be the effect of this declaration?

Question13: Assume that a customer's cart only includes one downloadable product.
What effect will it cause on the quote object?

Question14: You have been asked to display details from the customer's latest order on the customer's account dashboard (customer/account/). You create a new custom template to show the information.
How do you obtain an order repository so you can fetch an order?

Question15: A module you are working on needs to send a newsletter to all subscribed customers at predefined intervals.
Which two actions do you take to make sure the newsletter is sent? (Choose two.)

Question16: You are reviewing a Magento module and see a directory named Service.
What can you determine from this directory's name?

Question17: You have loaded an instance of Magento\Catalog\Model\Product in the $product variable. You know that the loaded product has the type configurable with four variations. These variations have the prices: $10, $12, $12,
$15.
What will be the result of the $product->getFinalPrice() call?

Question18: A custom module needs to log all calls of \Magento\Customer\Api\AddressRepositoryInterface::save().
Which mechanism do you use?

Question19: You need to find all orders in the processing state. You have written the code:

When you run the code, you get the following exception:

How do you resolve the exception?

Question20: Which entity in Magento supports scoped attributes?

Question21: How many shipping addresses may be selected for an order during the checkout process?

Question22: Products may be accessed using SEO friendly URLs like /my-product instead of /catalog/product/view/id/{ID} How is this one?

Question23: You are setting up a brand new Magento installation for a merchant who is migrating from Magento 1 to Magento 2.
Keeping in mind upgradability and the need to customize, which one do you choose?

Question24: How do you obtain customer information in a JavaScript module?

Question25: A merchant requires the ability to configure contact information for their brick and mortar stores as a CSV file upload. The module already exists and contains an etc/adminhtml/system.xml file where the new field can be added.
How do you specify the class that will process the uploaded file?

Question26: You are developing a module MyCompany_StoreInfo to display information about brick and mortar stores on a frontend page. The displayed information varies based on the country of a given store.
What two elements automatically render their children? (Choose two.)

Question27: During a code review of a module MyCompany_PaymentCurrencies you see a configuration field declared in the file etc/adminhtml/system.xml:

What is the consequence of the attribute showInStore being set to 0?

Question28: You have to install a new module on the production environment. All the module is adding a new product attribute. You enabled maintenance mode, copied the module code, run bin/magento setup:upgrade and disabled maintenance mode.
What two risks does this process pose? (Choose two.)

Question29: Assume that $collection is a new instance of a class that extends
Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection, and $ids is an array of ids.
How do you select a list of records from the database where the record ids are in the $ids list?

Question30: What are two functions of a resource model? (Choose two.)

Question31: How do you obtain customer information in a JavaScript module?

Question32: You got a notification about error that occurred on a production environment. The merchant gave you the error identifier.
How do you find the error message based on the identifier?

Question33: You have created a module controller that responds to the following URL: /mycompany/product/load/id/123.
Which two methods will load the product model by ID as specified in the URL? (Choose two.)

Question34: Which method of a Magento resource model will remove a record from the database?

Question35: What is the relationship between products and categories in Magento?

Question36: You have added a new attribute origin of the type varchar to the product entity.
Which two calls will filter a product collection with origin set to "California"? (Choose two.)